<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2.6.13"></script>
</head>
<body>
  <div id="app">
    父组件：{{ val }}
    <my-component v-model="val" />
  </div>

  <script>
    Vue.component('my-component', {
      model: {
        prop: 'num',
        event: 'returnBack'
      },
      props: {
        num: Number
      },
      methods: {
        back() {
          let number = this.num + 1
          this.$emit('returnBack', number)
        }
      },
      template: `
      <div>
        子组件：{{ num }} <br/>
        <button @click="back">点击</button>
      </div>
      `
    })

    const app = new Vue({
      el: '#app',
      data() {
        return {
          val: 0
        }
      }
    })
  </script>
</body>
</html>